import request from '@/utils/request'
const PREFIX_API = '/message'

// 分页
export const getPage = (data) => {
  return request({
    url: PREFIX_API + '/template/search',
    method: 'post',
    data
  })
}

// 获取通道App
export const getAppByChannelType = (data) => {
  return request({
    url: PREFIX_API + '/app/getAppByChannelType',
    method: 'post',
    data
  })
}

// 获取消息类型
export const getMessageTypeByChannelType = (data) => {
  return request({
    url: PREFIX_API + '/template/getMessageTypeByChannelType',
    method: 'post',
    data
  })
}

// 新增
export const saveTemplate = (data) => {
  return request({
    url: PREFIX_API + '/template/saveTemplate',
    method: 'post',
    data
  })
}

// 编辑
export const updateById = (data) => {
  return request({
    url: PREFIX_API + '/template/updateById',
    method: 'post',
    data
  })
}

// 删除
export const deleteByIds = (data) => {
  return request({
    url: PREFIX_API + '/template/deleteByIds',
    method: 'post',
    data
  })
}

// 根据id更改模板状态
export const updateStatusById = (data) => {
  return request({
    url: PREFIX_API + '/template/updateStatusById',
    method: 'post',
    data
  })
}
